<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <title>client</title>
  </head>
  <body>


    <button>159</button>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <script>
      const button = document.querySelector('button');
      button.addEventListener('click', () => {
        axios.post('http://127.0.0.1:3000/api/user/add', {
          username: 'coderwhy',
          password: '123456',
          avatar: 'http://127.0.0.1:3000/public/images/avatar.jpg',
          create_time: '2021-05-01 15:44:12',
          update_time: '2021-04-20 07:34:25'
        })
         .then(res => {
            console.log(res);
          })
         .catch(err => {
            console.log(err);
          });
      });
    </script>
    </script>
  </body>
</html>
